package com.example.demo.service;

import com.example.demo.entity.Articleinfo;
import com.example.demo.entity.Userinfo;
import com.example.demo.entity.vo.ArticleinfoVo;
import com.example.demo.mapper.ArticleMapper;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;



    public Userinfo getUserById(Integer id){
        return userMapper.getUserById(id);
    }

    public List<Userinfo> getAllUser(){
        return userMapper.getAllUser();
    }

    public int add(Userinfo userinfo){
        return userMapper.add(userinfo);
    }

    public int delete(int id){
        return userMapper.delete(id);
    }

    public int addGetId(Userinfo userinfo){
        return userMapper.addGetId(userinfo);
    }

    public int update(Userinfo userinfo){
        return userMapper.update(userinfo);
    }

    public List<Userinfo> getAllUserSort(String sort){
        return userMapper.getAllUserSort(sort);
    }
}
